Fix snapshot downloading on Python 3
authorChris Morgan <me@chrismorgan.info>
Wed, 3 Jun 2015 02:29:55 +0000 (12:29 +1000)
committerChris Morgan <me@chrismorgan.info>
Wed, 3 Jun 2015 02:29:55 +0000 (12:29 +1000)
commita1c8d5f96c7f0b3b2a2e1fa7f9b62d9b8cdaa8f0
treeb4f64a558617a3e03a1134c14c9beddc79ee4194
parent34a52a4468c129edf98b2af1ebca0a2dab927e64
Fix snapshot downloading on Python 3

This regression, introduced in d3f590f59ff72f1d3b457ed3716483ce472053c6
in #1674, caused `make` to fail on machines where `python` is Python 3
rather than Python 2, because `dict.keys()` returns a set-like object
that does not support indexing rather than a list.

`date = next(iter(snaps.keys()))` would be an adequate fix too, but I’m
not particularly happy with either of them, for neither would stand up
to the removal of the `break` statement: one is inadequate because
dictionaries are unordered collections, the other is inadequate because
`current` would refer to the *last* rather than the *first* snapshot in
the file.
src/etc/dl-snapshot.py